<?php
$fruits = array("name" => "jack", "passwd" => "123456", "age" => "23", "email" => "apple@qq.com");
ksort($fruits);
$str="";
foreach ($fruits as $key => $val) {
    echo "$key = $val\n";
    $str=$str."$key=$val";
}
echo $str;
echo "\n";
echo md5($str);
?>

/**
age=23email=apple@qq.comname=jackpasswd=123456
e1afbf467982a986d23707b6afe47ccc
*/